package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.huawei.appgallery.foundation.ui.framework.widget.Space;
import com.huawei.appmarket.service.store.awk.card.SmallCloverCard;
import kotlin.Metadata;
import kotlin.TypeCastException;
import o.azb;
import o.cdr;
import o.chz;
import o.eib;
import o.ewm.d;
import o.ewm.h;
import o.ewm.j;
import o.fsd;
import org.jetbrains.annotations.NotNull;

@Metadata(bv = {1, 0, 3}, d1 = {"\u00004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0018\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\nH\u0016J\b\u0010\f\u001a\u00020\rH\u0016J\u0018\u0010\u000e\u001a\u00020\b2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u000b\u001a\u00020\nH\u0016R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u000e¢\u0006\u0002\n\u0000¨\u0006\u0011"}, d2 = {"Lcom/huawei/appmarket/service/store/awk/node/SmallCloverNode;", "Lcom/huawei/appgallery/foundation/card/base/node/BaseDistNode;", "context", "Landroid/content/Context;", "(Landroid/content/Context;)V", "topBlankView", "Landroid/view/View;", "createChildNode", "", "rootLayout", "Landroid/view/ViewGroup;", "parent", "getCardNumberPreLine", "", "setData", "dataItem", "Lcom/huawei/appgallery/foundation/ui/framework/cardkit/bean/CardChunk;", "WiseDist_release"}, k = 1, mv = {1, 1, 15})
public final class SmallCloverNode extends cdr {
    private View ˊ;

    public SmallCloverNode(@NotNull Context context) {
        fsd.ˊ((Object) context, "context");
        super(context, 1);
    }

    public int ˏ() {
        return eib.ˊˋ() ? 2 : 4;
    }

    public boolean ˊ(@NotNull ViewGroup viewGroup, @NotNull ViewGroup viewGroup2) {
        fsd.ˊ((Object) viewGroup, "rootLayout");
        fsd.ˊ((Object) viewGroup2, "parent");
        azb.ˎ(viewGroup);
        LayoutParams layoutParams = new LayoutParams(-1, -1);
        layoutParams.weight = 1.0f;
        Context context = this.ॱ;
        fsd.ॱ(context, "context");
        LayoutParams layoutParams2 = new LayoutParams(context.getResources().getDimensionPixelSize(d.ˏॱ), -1);
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        View inflate = from.inflate(h.ᐝʾ, null);
        viewGroup.addView(inflate, layoutParams);
        this.ˊ = inflate.findViewById(j.ॱㆍ);
        azb.ˎ(inflate);
        LinearLayout linearLayout = (LinearLayout) inflate.findViewById(j.ʾʻ);
        int ˏ = ˏ();
        for (int i = 0; i < ˏ; i++) {
            if (i != 0) {
                linearLayout.addView(new Space(this.ॱ), layoutParams2);
            }
            inflate = from.inflate(h.ᐝˉ, null);
            if (inflate == null) {
                throw new TypeCastException("null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout");
            }
            ConstraintLayout constraintLayout = (ConstraintLayout) inflate;
            Context context2 = this.ॱ;
            fsd.ॱ(context2, "context");
            SmallCloverCard smallCloverCard = new SmallCloverCard(context2);
            smallCloverCard.ˏ((View) constraintLayout);
            ˊ(smallCloverCard);
            linearLayout.addView(constraintLayout, layoutParams);
        }
        return true;
    }

    public boolean ॱ(@NotNull chz o_chz, @NotNull ViewGroup viewGroup) {
        fsd.ˊ((Object) o_chz, "dataItem");
        fsd.ˊ((Object) viewGroup, "parent");
        View view = this.ˊ;
        if (view != null) {
            view.setVisibility(o_chz.ॱ == 0 ? 0 : 8);
        }
        return super.ॱ(o_chz, viewGroup);
    }
}
